<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWxStoreCategory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //微信门店分类
        Schema::create('wx_store_categorys', function (Blueprint $table) {
            $table->increments('id')->comment('分类ID');
            $table->unsignedInteger('pid')->default(0)->comment('父级分类ID');
            $table->string('name', 50)->comment('类目名称');
            $table->softDeletes();
            $table->timestamps();
        });
        //小程序门店分类
        Schema::create('wxa_store_categorys', function (Blueprint $table) {
            $table->increments('id')->comment('分类ID');
            $table->unsignedTinyInteger('pid')->default(0)->comment('父级分类ID');
            $table->string('name', 50)->comment('类目名称');
            $table->unsignedTinyInteger('level')->default(0)->comment('类目的级别');
            $table->unsignedTinyInteger('sensitive_type')->default(0)->comment('是否添加相关证件');
            $table->string('qualify_name', 150)->default('')->comment('相关证件的名字');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_store_categorys');
        Schema::dropIfExists('wxa_store_categorys');
    }
}
